﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Sites/Man/Main.master" AutoEventWireup="true" CodeFile="Create.aspx.cs" Inherits="Templates_Profile_Create" %>

<asp:Content ID="Content1" ContentPlaceHolderID="cphContent" Runat="Server">
    <script type="text/javascript">
        $(document).ready(function() {
            var id = "#<%=ddlCountry.ClientID%>";
            $(id).change(function() { setUsaOnly(); });
            setUsaOnly();
        }
        )

        var setUsaOnly = function() {
            var id = "#<%=ddlCountry.ClientID%> option:selected";
            var elem = $(id);
            var name = elem.text().toLowerCase().replace(/ /g, "");
            if (name == "usa" || name == "unitedstates" || name == "unitedstatesofamerica") {
                $(".usaOnly").show("fast");
                $(".usaOnly span.error").each(function() { this.enabled = true; });
            }
            else {
                $(".usaOnly").hide("fast");
                $(".usaOnly span.error").each(function() { this.enabled = false; });
            }
            alternateForm();
        }
        
    </script>
    <cex:RoundedBox ID="titleBox" Color="Grey" RoundedBottom="false" runat="server">
        <h2>Create profile</h2>
    </cex:RoundedBox>
    <div class="spacer" style="border-top:3px solid #c2bcb6; background-color:#ffffff"></div>
    <cex:RoundedBox ID="content" Color="White" RoundedTop="false" runat="server">
        <asp:Panel CssClass="form" DefaultButton="btnSubmit" runat="server">
            <div class="colA alternate">
	            <ul class="col first">
    	            <li class="formItem">
    	                <asp:Image ID="Image1" runat="server" style="float:left;" ImageUrl="~/Sites/Man/img/blank-profile.gif" AlternateText="Blank Profile Picture" Width="70px"  />
	                    <asp:Label ID="Label1" CssClass="formLabel" AssociatedControlID="upload" runat="server">Profile Picture</asp:Label>
	                    <div class="clear"></div>
	                    <asp:FileUpload ID="upload" runat="server" />
                    </li>
                </ul>
                <ul class="col">
    	            <li class="formItem">
    	                <asp:RequiredFieldValidator ID="valFirstName" ValidationGroup="CreateProfile" ControlToValidate="txtFirstName" CssClass="error required" ErrorMessage="!" Display="Dynamic" runat="server" />
                        <asp:Label ID="lblFirstName" CssClass="formLabel required" runat="server" Text="First Name*" AssociatedControlID="txtFirstName"/>
                        <span class="formInput">
                            <asp:TextBox ID="txtFirstName" runat="server" />
                        </span>
                    </li>
                    <li class="formItem">
    	                <asp:RequiredFieldValidator ID="valLastNameReq" ValidationGroup="CreateProfile" ControlToValidate="txtLastName" CssClass="error required" ErrorMessage="!" Display="Dynamic" runat="server" />
                        <asp:Label ID="lblLastName" CssClass="formLabel required" runat="server" Text="Last Name*" AssociatedControlID="txtLastName"/>
                        <span class="formInput">
                            <asp:TextBox ID="txtLastName" runat="server" />
                        </span>
                    </li>
                    <li class="formItem">
    	                <asp:RequiredFieldValidator ID="valDepartmentReq" ValidationGroup="CreateProfile" ControlToValidate="txtDepartment" CssClass="error required" ErrorMessage="!" Display="Dynamic" runat="server" />
                        <asp:Label ID="lblDepartment" CssClass="formLabel required" runat="server" Text="Department*" AssociatedControlID="txtDepartment"/>
                        <span class="formInput">
                            <asp:TextBox ID="txtDepartment" runat="server" />
                        </span>
                    </li>
                    <li class="formItem">
    	                <asp:RequiredFieldValidator ID="valCountryReq" ValidationGroup="CreateProfile" ControlToValidate="ddlCountry" CssClass="error required" ErrorMessage="!" Display="Dynamic" runat="server" />
                        <asp:Label ID="Label31" CssClass="formLabel required" runat="server" AssociatedControlID="ddlCountry" Text="Country*"/>
                        <span class="formInput">
                            <asp:DropDownList ID="ddlCountry" AppendDataBoundItems="true" runat="server">
	                            <asp:ListItem Text="Select Country..." Value=""/>
	                        </asp:DropDownList>
	                   </span>
                    </li>
                    <li class="formItem usaOnly" style="display:none;">
    	                <asp:RequiredFieldValidator ID="valStateReq" ValidationGroup="CreateProfile" ControlToValidate="ddlState" CssClass="error required" ErrorMessage="!" Display="Dynamic" runat="server" />
                        <asp:Label ID="lblState" CssClass="formLabel required" runat="server" AssociatedControlID="ddlState" Text="State*"/>
                        <span class="formInput">
                            <asp:DropDownList ID="ddlState" runat="server">
	                            <asp:ListItem Text=""/>
	                            <asp:ListItem Text="Idaho" Value="Idaho"/>
	                            <asp:ListItem Text="Utah" Value="Utah"/>
	                            <asp:ListItem Text="Washington" Value="Washington"/>
	                        </asp:DropDownList>
	                   </span>
                   </li>
    	            <li class="formItem">
    	                <asp:RequiredFieldValidator ID="valEmailReq" ValidationGroup="CreateProfile" ControlToValidate="txtEmail" CssClass="error required" ErrorMessage="!" Display="Dynamic" runat="server" />
                        <asp:Label ID="lblEmail" CssClass="formLabel required" runat="server" Text="Email*" AssociatedControlID="txtEmail"/>
                        <asp:Panel ID="pnlDuplicateEmailError" CssClass="validationError" EnableViewState="false" Visible="false" runat="server">
                            This Email Address is already in use. Login or use forgotten password.
                        </asp:Panel>
                        <asp:Panel ID="pnlNonApprovedEmail" CssClass="validationError" EnableViewState="false" Visible="false" runat="server">
                            This Email Address does not match any of the restrictions in place.
                        </asp:Panel>
                        <asp:RegularExpressionValidator ID="valEmailFormat" ValidationGroup="CreateProfile" ControlToValidate="txtEmail" CssClass="error" ErrorMessage="Invalid Email Address" Display="Dynamic" runat="server" />
                        <span class="formInput">
                            <asp:TextBox ID="txtEmail" runat="server" />
                        </span>
                   </li>
    	            <li class="formItem">
    	                <asp:RequiredFieldValidator ID="valPasswordReq" ValidationGroup="CreateProfile" ControlToValidate="txtPassword" CssClass="error required" ErrorMessage="!" Display="Dynamic" runat="server" />
                        <asp:Label ID="lblPassword" CssClass="formLabel required" runat="server" Text="Password*" AssociatedControlID="txtPassword"/>
                        <asp:RegularExpressionValidator ID="valPasswordFormat" ValidationGroup="CreateProfile" ControlToValidate="txtPassword" CssClass="error" Display="Dynamic" runat="server" />
                        <span class="formInput">
                            <asp:TextBox ID="txtPassword" TextMode="Password" runat="server" />
                        </span>
                   </li>
    	            <li class="formItem">
    	                <asp:RequiredFieldValidator ID="valConfirmPasswordReq" ValidationGroup="CreateProfile" ControlToValidate="txtConfirmPassword" CssClass="error required" ErrorMessage="!" Display="Dynamic" runat="server" />
                        <asp:Label ID="lblConfirmPasswordReq" CssClass="formLabel required" runat="server" Text="Confirm Password*" AssociatedControlID="txtConfirmPassword"/>
                        <asp:CompareValidator ID="valConfirmPasswordMatch" ValidationGroup="CreateProfile" ControlToCompare="txtPassword" ControlToValidate="txtConfirmPassword" ErrorMessage="Passwords do not match" Display="Dynamic" runat="server" />
                        <span class="formInput">
                            <asp:TextBox ID="txtConfirmPassword" TextMode="Password" runat="server" />
                        </span>
                   </li>
                </ul>
                <ul class="col last">
                    <li class="formItem">
                        <asp:Label ID="lblComment" CssClass="formLabel" runat="server" AssociatedControlID="txtComment" Text="Comment (Optional)" />
                        <span class="formInput">
                            <asp:TextBox runat="server" ID="txtComment" TextMode="MultiLine"/>
                        </span>
                    </li>
                </ul>
                <div class="clear"></div>
            </div>
            <hr />
            <div class="colA">
                <ul class="col first">
                    <li>&nbsp;</li>
                </ul>
                <ul class="col">
                    <li>&nbsp;</li>
                </ul>
                <ul class="col last">
                    <li class="formItem" style="text-align:right;height:35px;">
                        <asp:CheckBox ID="cboAnon" Text="I would like my profile to be anonymous" TextAlign="Left" runat="server" />
                    </li>
                </ul>
                <div class="clear"></div>
            </div>
            <div class="buttons">
                <asp:Panel ID="pnlGeneralError" CssClass="validationError" EnableViewState="false" Visible="false" runat="server">
                    <ul id="ulGeneralErrors" runat="server">
                        
                    </ul>
                </asp:Panel>
                <asp:Label runat="server" Text="*=Required Field" CssClass="formLabel" />
                <asp:Button ID="btnSubmit" Text="Submit" ValidationGroup="CreateProfile" runat="server" />
            </div>
        </asp:Panel>
    </cex:RoundedBox>
</asp:Content>

